home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-04-18 | 1.6 KB | 38 lines | [TEXT/GEOL] |
- Item 3273168 18-April-89 11:26
-
- From: ROSENSTEIN1 Rosenstein, Larry
-
- To: D2987 Command Central, R Andrews, PRT
-
- cc: MACAPP.TECH$ MACAPP Tech
-
- Sub: re Overriding NEW
-
- MacApp calls the method TApplication.OpenNew to open a new document. The
- method takes a command number as parameter to tell you which menu command was
- used to initiate the process.
-
- For opening a new document from the Finder, the command number will be the
- constant cNew. You can override OpenNew and check for this value to see if the
- user double clicked the application.
-
- I prefer using this mechanism to overriding HandleFinderRequest, because it
- doesn't require that you look at the gFileCount global. In addition, if you
- have to override OpenNew to put up your configuration dialog, you might as well
- do all the work in one place.
-
- Finally, Keith's answer assumes that the configuration information you get from
- the dialog is kept in global variables. If the information is to be used in
- creating the document itself, you may want to put up the dialog in your
- TMyApplication.DoMakeDocument method. Then you can pass the information to
- your IMyDocument method.
-
- In that case, if the user cancels, you should not create the document object,
- and call Failure(noErr, 0). The Failure call will unwind the stack back to the
- main loop, but since the error code (the first parameter to Failure) is noErr,
- no alert will be displayed. MacApp should recover and continue processing
- events.
-
- Larry
-
-